<%-- 通过import引用其他的Java类 --%>
<%@ page import="bean.UserInfo" %>
<%@ page import="java.util.List" %>
<%@ page import="cp6.DataReadTool" %>
<%--
  Created by IntelliJ IDEA.
  User: yaclt
  Date: 2021/11/26 0026
  Time: 15:28
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
<%
    // 调用其他java类的方法
    List<UserInfo> userList = DataReadTool.getAllUser();
    out.println(userList);
%>
<table style="width: 400px" border="1">
    <tr>
        <td>id</td>
        <td>昵称</td>
    </tr>
    <% for (UserInfo u : userList) { %>
    <tr>
        <td><%=u.getId()%></td>
        <td><%=u.getNickname()%></td>
    </tr>
    <%}%>
</table>
</body>
</html>
